<template>
  <view class="content border">
    <view
      class="organization-content border-wrap"
      v-for="(item, index) in dataList"
      :key="index">
      <h3 class="title"
        >检测单位名称：<label>{{ item.jiancdwmc }}</label></h3
      >
      <ul class="organization">
        <li
          ><span>报告名称：</span><label>{{ item.baogmc }}</label></li
        >
        <li>
          <span>报告编号：</span><label>{{ item.baogbh }}</label>
        </li>
        <li
          ><span>施工单位：</span><label>{{ item.shigwtdw }}</label>
        </li>
        <li>
          <span>工程名称：</span><label>{{ item.gongcmc }}</label>
        </li>
        <li>
          <span>工程部位：</span><label>{{ item.gongcbwyt }}</label>
        </li>
        <li>
          <span>样品名称：</span><label>{{ item.yangpmc }}</label>
        </li>
        <li>
          <span>样品编号：</span><label>{{ item.yangpbh }}</label>
        </li>
        <li>
          <span>样品描述：</span><label>{{ item.yangpzt }}</label>
        </li>
        <li>
          <span>报告日期：</span><label>{{ item.shiyjcrq }}</label>
        </li>
        <li>
          <span>报告结论：</span>
          <label>
            {{ item.jiancjl }}
          </label>
        </li>
        <li><span>报告结果：</span>{{ item.excelResult == 2 ? "不合格" : "合格" }}</li>
        <li><span>签署状态：</span>{{ item.qianszt }}</li>
      </ul>
    </view>
  </view>
</template>

<script>
  import { getBgInfos } from "@/api/index";
  import { getUrlParam } from "@/utils";
  export default {
    data() {
      return {
        reportId: "",
        dataList: [],
      };
    },
    onLoad() {
      this.getInfo();
    },
    methods: {
      getInfo() {
        const reportId = getUrlParam("reportId");
        console.log(reportId);
        this.reportId = reportId;
        if (!reportId) {
          return;
        }
        const params = {
          reportId: this.reportId,
        };
        this.$modal.loading("加载中");
        getBgInfos(params)
          .then(data => {
            this.dataList = data;
          })
          .finally(e => {
            this.$modal.closeLoading();
          });
      },
    },
  };
</script>

<style lang="scss">
  .border {
    padding-bottom: 40rpx;
  }
  h3.title {
    border-left: 10rpx solid #2daed3;
    // height: 40rpx;
    line-height: 40rpx;
    padding: 12rpx 0 12rpx 20rpx;
    border-bottom: 1rpx #ccc solid;
    margin-left: -1rpx;
  }
  .content ul li {
    padding: 23rpx 0 23rpx 25rpx;
    border-bottom: 1rpx #ccc solid;
  }
  .content ul li:last-child {
    border-bottom: none;
  }
  .content ul li span {
    width: 160rpx;
    display: inline-block;
    text-align: right;
  }
  .organization-content {
    margin-bottom: 40rpx;
  }
  ul li.detail a {
    display: inline-block;
    width: 100%;
    text-align: center;
  }
</style>
